import request from '@/utils/request'

// 查询预定列表
export function listReserve(query) {
  return request({
    url: '/data/reserve/list',
    method: 'get',
    params: query
  })
}

// 查询预定详细
export function getReserve(reserveId) {
  return request({
    url: '/data/reserve/' + reserveId,
    method: 'get'
  })
}

// 新增预定
export function addReserve(data) {
  return request({
    url: '/data/reserve',
    method: 'post',
    data: data
  })
}

// 修改预定
export function updateReserve(data) {
  return request({
    url: '/data/reserve',
    method: 'put',
    data: data
  })
}

// 删除预定
export function delReserve(reserveId) {
  return request({
    url: '/data/reserve/' + reserveId,
    method: 'delete'
  })
}
//查询哪些时间被预约了
export function queryAppointmentTime(roomNumber) {
  return request({
    url: '/data/reserve/listQueryTime?roomNumber=' + roomNumber,
    method: 'get'
  })
}
//根据入住时间查询
export function queryAppointmentJoinTime(data) {
  return request({
    url: '/data/reserve/listQueryTimeByJoinTime',
    method: 'get',
    params: data
  })
}
// 查询预定列表
export function listReserveByUserName(userName,pageSize,pageNum) {
  return request({
    // url: '/data/reserve/listReserveByUserName?userName='+userName+'&?pageSize='+pageSize+'&?pageNum='+pageNum,
    url: '/data/reserve/listReserveByUserName?pageSize='+pageSize+'&pageNum='+pageNum+'&userName='+userName,
    method: 'get',
  })
}


